<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.shiyue.com/shiyue" prefix="dg" %>
<%
String path = request.getContextPath();  
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>我的桌面</title>
    	<link rel="stylesheet" type="text/css" href="<%=path %>/css/main.css"/>
	<link href="<%=path %>/css/dialog.css" rel="stylesheet" type="text/css" />
	<script src="<%=path%>/js/resizeIframe.js" type="text/javascript"></script>
	<script language="javascript" src="<%=path %>/js/syAjax.js"></script>
	<script src="<%=path%>/js/dialog.js" type="text/javascript"></script>
	<script src="<%=path %>/js/jquery-1.7.2.min.js"></script>
	<script src="<%=path %>/js/core.js"></script>

	<script type="text/javascript">
	  window.onload = function(){
		parent.setIframeHeight(617);
		/**获取未读邮件数量*/
		syAjax.request("post","<%=path %>/getNotReadDocCountDocAction.action","",{success:function (response){
		if(null!=document.getElementById('notReadCountSPAN')){
	  		document.getElementById('notReadCountSPAN').innerHTML=response;
	  	}
	  },fail:onFail,type:'plain'});
	  
	  /**如果用户的img字段不为空，才显示，否则，显示默认的图片*/
	  <c:if test="${not empty requestScope.UserInfo.img}">
            	document.getElementById('userImg').src="${applicationScope.currentEnclosureServer.outUrl }/enclosure/${requestScope.UserInfo.img}";
       </c:if>
	  
	  
	 }
	 
	 function go(url,name){
	 	parent.go(url,name);
	 }
	 
	   //到资源详细页面
		function goResourceDetail(id){
			window.open("<%=path%>/findByTrResourceIdTrResourceAction.action?trResource.resourceId="+id+"&t="+new Date()+"&notRefresh=yes");
	    }
	    /**邮件详细信息页面*/
		 function toDocInfo(docId){
    		window.open("<%=path%>/toDocInfoDocAction.action?doc.docId="+docId+"&delMsg=receiver");
    	}
    	/**以window.open的方式打开请求的页面*/
    	function openNewPage(url){
    		window.open(url+"?t="+new Date());
    	}
    	/**部门日志、部门总结详细信息页面*/
		function showDeptLogDetail(scheduleLogId){
			window.open("<%=path%>/toLogDetailscheduleLogAction.action?scheduleLog.logId="+scheduleLogId);
		}
		
			//到创建邮件页面
	function toAddDocument(){
		window.open("<%=path%>/toAddDocDocAction.action?t="+new Date());
	}
	
		//到详细页面
	function toBbsInfo(articleId){
		window.open("<%=path%>/findBbsArticleByIdBbsAction.action?bbsArticle.articleId="+articleId+"&t="+new Date()+"&notRefresh=yes");
    }
    
      function toMessageInfo(userName,content) {
	     	document.getElementById("projectDialogdialogDIV").style.left = "150px";
	     	document.getElementById("projectDialogdialogDIV").style.top = "50px";
	     	document.getElementById("message_content").innerHTML=content;
	     	document.getElementById("message_name").innerHTML="<br>"+userName;     	
	    	showDialog("projectDialog");
	    	resizeIframe();
	  }
	  
	  function simpleSure(){
	  		/**请不要删除这个函数，因为这是可拖动div标签的规范，否则会造成页面重新加载。*/
	  }
	    
	    
    
   
</script>
  </head>
  
  <body>
  
	<div id="main">
	
    <div class="info">
    	<div class="title1"><img src="<%=path%>/images/sign.gif" />个人信息</div>
        <div class="info_content">
            <div class="info_photo">
            	<img id="userImg" src="<%=path%>/images/photo.gif" width="84" height="90" />
            </div>
            <p><b>${requestScope.UserInfo.name }</b></p>
            <p>性别：${requestScope.sexName }</p>
            <p>职称：${requestScope.professionalName }</p>
            <p>账号：${requestScope.UserInfo.account }</p>
            <div class="dot"></div>
            <p>手机号码：${requestScope.UserInfo.mobileNumber1 }</p>
            <p>办公电话：${requestScope.usernelInfo.call }</p>
            <p>家庭住址：${requestScope.UserInfo.address }</p>
            <p>邮　 &nbsp;编：${requestScope.UserInfo.zipCode }</p>
            <p>邮　 &nbsp;箱：${requestScope.UserInfo.email }</p>
            <div class="dot"></div>
            <div class="more1" onclick="go('<%=path %>/findUserByIdUserAction.action?user.userId=${requestScope.UserInfo.userId}','协同办公>>个人档案');">更多>></div>
        </div>
    </div>
    <div class="notice">
        	<ul class="notice_content">
        		<c:if test="${not empty requestScope.gonggaoList}">
        			<c:forEach items="${requestScope.gonggaoList}" var="docReceiver">
        				<li>
        				<a href="javascript:toDocInfo('${docReceiver.id.doc.docId}');">
        					<c:if test="${fn:length(docReceiver.id.doc.name)>20 }">${fn:substring(docReceiver.id.doc.name,0,20)}</c:if>
							<c:if test="${fn:length(docReceiver.id.doc.name)<=20 }">${docReceiver.id.doc.name }</c:if>
							（<fmt:formatDate type="date" value='${docReceiver.id.doc.publishTime }' pattern="MM-dd" />）
						</a>
						</li>	
        			</c:forEach>
        			
        		</c:if>
            	
               
            </ul>
        </div>
    <div class="big_btn">
    	<img src="<%=path%>/images/btn1.gif" />
        <img src="<%=path%>/images/btn2.gif" onclick="toAddDocument();" />
    </div>
    <div class="remind">
    	<div class="title2">
        	<div class="tabs"><div class="tab_l"></div><div class="tab_c">待办事宜（20）</div><div class="tab_r"></div></div>
            <div class="tabs"><div class="tab_l"></div><div class="tab_c">校内通知</div><div class="tab_r"></div></div>
            <div class="tabs"><div class="tab_l"></div><div class="tab_c">部门计划</div><div class="tab_r"></div></div>
            <div class="tabs"><div class="tab_l"></div><div class="tab_c">部门日志</div><div class="tab_r"></div></div>
            <div class="tabs"><div class="tab_l"></div><div class="tab_c">个人日志</div><div class="tab_r"></div></div>
        </div>
        <ul class="remind_content" id="r1">
        	<li><b>【邮件】</b>有<a href="javascript:go('<%=path%>/findDocByReceiverIdAndStatusDocAction.action?','协同办公>>收件箱');"><span id="notReadCountSPAN" class="remind_num"></span></a>封邮件待查阅。</li>
        	<li><b>【公文】</b>有<a href="javascript:openNewPage('<%=path%>/toRemind1012scheduleJobInformationAction.action');"><span class="remind_num">${requestScope.REMINDCOUNTMAP['remind1012'] }</span></a>封公文待审批。</li>
            <li><b>【文印】</b>有<a href="javascript:openNewPage('<%=path%>/toRemind1013scheduleJobInformationAction.action');"><span class="remind_num">${requestScope.REMINDCOUNTMAP['remind1013'] }</span></a>封文印信息待查阅。</li>
            <li><b>【报修】</b>有<a href="javascript:openNewPage('<%=path%>/toRemind1014scheduleJobInformationAction.action');"><span class="remind_num">${requestScope.REMINDCOUNTMAP['remind1014'] }</span></a>封报修信息待查阅。</li>         
            <li><b>【场馆】</b>有<a href="javascript:openNewPage('<%=path%>/toRemind1015scheduleJobInformationAction.action');"><span class="remind_num">${requestScope.REMINDCOUNTMAP['remind1015'] }</span></a>封场馆信息待查阅。</li>  
        </ul>
        <ul class="remind_content" id="r2" style="list-style: disc;">
        		<c:if test="${not empty requestScope.tongzhiList}">
        			<c:forEach items="${requestScope.tongzhiList}" var="docReceiver">
        				<li>
        				<a href="javascript:toDocInfo('${docReceiver.id.doc.docId}');">
        					<c:if test="${fn:length(docReceiver.id.doc.name)>20 }">${fn:substring(docReceiver.id.doc.name,0,20)}</c:if>
							<c:if test="${fn:length(docReceiver.id.doc.name)<=20 }">${docReceiver.id.doc.name }</c:if>
							（<fmt:formatDate type="date" value='${docReceiver.id.doc.publishTime }' pattern="MM-dd" />）
						</a>
						</li>	
        			</c:forEach>
        			
        		</c:if>
        </ul>
        <ul class="remind_content" id="r3" style="list-style: disc;">
        	<c:if test="${not empty requestScope.planList}">
        		<c:forEach items="${requestScope.planList}" var="log">
        			<li>
        				<a href="javascript:showDeptLogDetail('${log[0].logId}');">
        				<c:if test="${fn:length(log[0].title)>20 }">${fn:substring(log[0].title,0,20)}</c:if>
						<c:if test="${fn:length(log[0].title)<=20 }">${log[0].title }</c:if>
						</a>
        			</li>
        		</c:forEach>
        	</c:if>
        	<c:if test="${empty requestScope.planList}">
        		<li>暂无部门计划</li>	
        	</c:if>
        	
            
        </ul>
        <ul class="remind_content" id="r4" style="list-style: disc;">
        	 <c:if test="${not empty requestScope.deptList}">
        		<c:forEach items="${requestScope.deptList}" var="log">
        			<li>
        				<a href="javascript:showDeptLogDetail('${log[0].logId}');">
        				<c:if test="${fn:length(log[0].title)>20 }">${fn:substring(log[0].title,0,20)}</c:if>
						<c:if test="${fn:length(log[0].title)<=20 }">${log[0].title }</c:if>
						</a>
        			</li>
        		</c:forEach>
        	</c:if>
        	<c:if test="${empty requestScope.deptList}">
        		<li>暂无部门日志</li>	
        	</c:if>
        </ul>
        <ul class="remind_content" id="r5" style="list-style: disc;">
        	 <c:if test="${not empty requestScope.meList}">
        		<c:forEach items="${requestScope.meList}" var="log">
        			<li>
        				<a href="javascript:showDeptLogDetail('${log[0].logId}');">
        				<c:if test="${fn:length(log[0].title)>20 }">${fn:substring(log[0].title,0,20)}</c:if>
						<c:if test="${fn:length(log[0].title)<=20 }">${log[0].title }</c:if>
						</a>
        			</li>
        		</c:forEach>
        	</c:if>
        	<c:if test="${empty requestScope.meList}">
        		<li>暂无个人日志</li>	
        	</c:if>
        </ul>
    </div>
    <div class="message">
    	<div class="title2">
        	<div class="tabs"><div class="tab_l"></div><div class="tab_c">在线留言</div><div class="tab_r"></div></div>
            <div class="tabs"><div class="tab_l"></div><div class="tab_c">论坛</div><div class="tab_r"></div></div>
        </div>
        <ul class="message_content" id="m1">
        	<c:if test="${not empty requestScope.messageList}">
        		<c:forEach items="${requestScope.messageList}" var="message">
        			<a href="javascript:toMessageInfo('${message.user.name }','${message.content}');"><li>
        			
        			<c:if test="${fn:length(message.content)>14 }">${fn:substring(message.content,0,14)}</c:if>
        			<c:if test="${fn:length(message.content)<=14 }">${message.content}</c:if>
        			</li></a>	
        		</c:forEach>
        	</c:if>
        	<c:if test="${empty requestScope.messageList}">
        		<li>暂无留言</li>
        	</c:if>
        	

            <div class="dot"></div>
            <div align="right"><a href="javascript:openNewPage('<%=path %>/oa/addLeaveMessage.jsp');" style="color: #0d80d7;">发表>></a>&nbsp;&nbsp;<a href="<%=path %>/toListOaLeaveMessageAction.action" style="color: #0d80d7;">更多>></a></div>
        </ul>
        <ul class="message_content" id="m2">
        	<c:if test="${not empty requestScope.articleList}">
        		<c:forEach items="${requestScope.articleList}" var="article">
        			<a href="javascript:toBbsInfo('${article.articleId }');"><li>${article.title }</li></a>		
        		</c:forEach>
        	</c:if>
        	
         
        </ul>
    </div>
    <div class="resource">
    	<div class="title1"><img src="<%=path%>/images/sign.gif" />教学资源<span class="more2" onclick="go('<%=path %>/findAllNewTrResourceAction.action?','资源建设>>下载资源');">更多>></span></div>
        <ul class="resource_content">
        	<c:if test="${not empty requestScope.resourceList}">
        		<c:forEach items="${requestScope.resourceList}" var="resource">
        			<li><a href="javascript:goResourceDetail('${resource[0].resourceId }');">${resource[0].title }</a></li>		
        		</c:forEach>
        	</c:if>
        	<c:if test="${empty requestScope.resourceList}">
        		<li>暂无教学资源</li>
        	</c:if>
        	
        </ul>
    </div>
    <div class="time_table">
    	<div class="title2">
        	<div class="tabs"><div class="tab_l"></div><div class="tab_c">我的课表</div><div class="tab_r"></div></div>
        </div>
        <table class="time_table_content">
        	<thead>
                <tr>
                    <th width="39px;">节次</th><th width="78px;">周一</th><th width="78px;">周二</th><th width="78px;">周三</th><th width="78px;">周四</th><th width="78px;">周五</th>
                </tr>
			</thead>
            <tbody>
            	<c:if test="${not empty requestScope.cstList}">
              	<c:forEach items="${requestScope.cstList}" var="cst">
                <tr>
                    <th>${cst.classSectionName }</th>
                    <td><c:set var="monday" value="1_${cst.classSectionId}" scope="page"></c:set>${requestScope.TIMETABLEMAP[pageScope.monday]}</td>
                 	<td><c:set var="tuesday" value="2_${cst.classSectionId}" scope="page"></c:set>${requestScope.TIMETABLEMAP[pageScope.tuesday]}</td>
		            <td><c:set var="wednesday" value="3_${cst.classSectionId}" scope="page"></c:set>${requestScope.TIMETABLEMAP[pageScope.wednesday]}</td>
		            <td><c:set var="thursday" value="4_${cst.classSectionId}" scope="page"></c:set>${requestScope.TIMETABLEMAP[pageScope.thursday]}</td>
		            <td><c:set var="friday" value="5_${cst.classSectionId}" scope="page"></c:set>${requestScope.TIMETABLEMAP[pageScope.friday]}</td>
                </tr>
               	</c:forEach>
              	</c:if>
              	<c:if test="${empty requestScope.cstList}">
              		<tr>
              		<th colspan="6">暂无节次信息</th>
              		</tr>
              	</c:if>
            </tbody>
        </table>
        
        
    </div>
    <div class="fast_track">
    	<div class="title1"><img src="<%=path%>/images/sign.gif" />快速通道<span class="more2">&nbsp;</span></div>
        <div class="fast_track_items"><a href="#"><img src="<%=path%>/images/item_1.gif" />请假管理</a></div>
        <div class="fast_track_items"><a href="#"><img src="<%=path%>/images/item_2.gif" />班级常规</a></div>
        <div class="fast_track_items"><a href="javascript:go('<%=path%>/toVenuesListOaSpecialVenuesAction.action?','场所管理>>');"><img src="<%=path%>/images/item_3.gif" />场所管理</a></div>
        <div class="fast_track_items"><a href="javascript:go('<%=path %>/findmarkExamInfoByYearAndSchoolTermAndGradeIdAndTypemarkArrangeExamAction.action?markExamInfo.year=2012-2013&markExamInfo.schoolTerm=1&flg=innermark','成绩导入>>');"><img src="<%=path%>/images/item_4.gif" />成绩导入</a></div>
        <div class="fast_track_items"><a href="javascript:go('<%=path %>/toExamInfoListForSingleStatisticsmarkArrangeExamAction.action?markExamInfo.year=2012-2013&markExamInfo.schoolTerm=1','成绩报表>>');"><img src="<%=path%>/images/item_5.gif" />成绩报表</a></div>
        <div class="fast_track_items"><a href="#"><img src="<%=path%>/images/item_6.gif" />选课设置</a></div>
        <div class="fast_track_items"><a href="#"><img src="<%=path%>/images/item_7.gif" />课程设计</a></div>
        <div class="fast_track_items"><a href="#"><img src="<%=path%>/images/item_8.gif" />教研评课</a></div>
        <div class="fast_track_items"><a href="javascript:go('<%=path%>/toAddTrResourceTrResourceAction.action?','资源上传>>');"><img src="<%=path%>/images/item_9.gif" />资源上传</a></div>
    </div>
</div>
 <dg:dialog title="留言详情" id="projectDialog" simple="true" sureFunction="simpleSure();">
	   	<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 12px;">
       <tr>
        <td id="message_content" align="left">
        &nbsp;
        </td>
        </tr>
         <tr>
        <td align="right" id="message_name">
           
         </td>
        </tr>                       
     </table>
     </dg:dialog>
</body>

</html>
